package com.example.demo08;

import android.os.Bundle;
import android.support.v4.app.e;
import android.util.Log;
import android.view.View;

public class CryptPage extends BaseTextPage {

	@Override
	public void onViewCreated(View view, Bundle savedInstanceState) {
		super.onViewCreated(view, savedInstanceState);
		
		String key = "UITN25LMUQC436IM";

		String src = "Hello Wolld!";
		
		String enc = e.encrypt1(src);
		String dec = e.decrypt1(enc);
		
		String s = e.decrypt1("nX0+/gS3Hw+0v5UpFWUtyA==");
		String ss = e.decrypt1("oEoz8+/L/hoD9K7qqzkOqni3erSscIegv0HmzHH6pQo=");
		String sss = e.decrypt3("KOxltDfZfdQu3Ku80aXydBR2hNSFR2UERLUzBoUlZTag==uA==");
		
		append("src=").append(src).append("\n")
		.append("enc=").append(enc).newLine()
		.append("dec=").append(dec).newLine()
//		.append("enc3=").append(e.e).newLine()
		.append("dec1=").append(s).newLine()
		.append("dec1=").append(ss).newLine()
		.append("dec3=").append(sss).newLine()
		.append("done").newLine()
		.update();
		
		for(int i=0; i<sss.length(); i++)
			System.out.print("0x" + Integer.toHexString(sss.charAt(i)));
		System.out.println();
		System.out.println('\b');
		
		Log.i("Crypt", toString());
	}
}
